﻿using System;
using System.Drawing;

namespace Database
{
    public class Person
    {
        public readonly String _firstName;
        private readonly String _middleName;
        private readonly String _secondName;

        private readonly int _passportSeries;
        private readonly int _passportNumber;

        private DateTime _birthDate;

        public Image Image { get; private set; }

        // for database loading
        public Person(string firstName, string middleName, string secondName, Image image)
        {
            _firstName = firstName;
            _middleName = middleName;
            _secondName = secondName;

            Image = image;
        }

        public Person(string firstName, string middleName, string secondName, DateTime birthDate, int passportSeries,
                      int passportNumber, Image image)
        {
            _firstName = firstName;
            _middleName = middleName;
            _secondName = secondName;

            _passportSeries = passportSeries;
            _passportNumber = passportNumber;

            _birthDate = birthDate;

            Image = image;
        }

        public string GetSqlData()
        {
            return "'" + _firstName + "', " +
                   "'" + _middleName + "', " +
                   "'" + _secondName + "', " +
                   "'" + _birthDate.ToShortDateString() + "', " +
                   _passportSeries + ", " +
                   _passportNumber;
        }

        public string GetFullName()
        {
            return _firstName + " " + _middleName + " " + _secondName;
        }
    }
}
